import { Injectable } from '@angular/core';
import {GlobalAjaxService} from '../../services/global-ajax.service';

@Injectable({
  providedIn: 'root',
})
export class MainService {

  constructor(
    private gjs: GlobalAjaxService
  ) { }

  public getPrjMens(data, success, failed): void {
    this.gjs.request({
      url: '/mens',
      type: 'post',
      async: true,
      data, success, failed
    });
  }

  /**
   * @param data { username: string, password: string }
   * @param success
   * @param failed
   */
  public login(data, success, failed): void {
    this.gjs.request({
      url: '/admin/user/login',
      type: 'post',
      async: true,
      data, success, failed
    });
  }
}
